From 473e020902bd7413b979e047429e2096e3933825 Mon Sep 17 00:00:00 2001 From: "smh22@firebug.cl.cam.ac.uk" Date: Wed, 29 Mar 2006 18:06:27 +0100 Subject: [PATCH] Fix save/restore bug; further rationalization of xenbus state machine logic deferred until post 3.0.2. Signed-off-by: Steven Hand --- linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c index 82625a9715..23fe51a362 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c @@ -253,15 +253,20 @@ static void frontend_changed(struct xenbus_device *dev, switch (frontend_state) { case XenbusStateInitialising: - case XenbusStateConnected: break; case XenbusStateInitialised: + case XenbusStateConnected: + /* Ensure we connect even when two watches fire in + close successsion and we miss the intermediate value + of frontend_state. */ + if (dev->state == XenbusStateConnected) + break; + err = connect_ring(be); - if (err) { - return; - } - update_blkif_status(be->blkif); + if (err) + break; + update_blkif_status(be->blkif); break; case XenbusStateClosing: -- 2.30.2